<?php

/**
 * @version   1.13 April 15, 2011
 * @author    RocketTheme http://www.rockettheme.com
 * @copyright Copyright (C) 2007 - 2011 RocketTheme, LLC
 * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
 */
$active_plugins = get_option('active_plugins');
//if (!in_array('gantry/gantry.php', $active_plugins)) {
//    if (!is_admin()) {
//        add_filter('template_include', 'gantry_missing_nag', -10, 0);
//    } else {
//        add_action('admin_notices', 'gantry_admin_missing_nag');
//    }
//}

function gantry_admin_missing_nag() {
    $msg = __('The active theme requires the Gantry Framework Plugin to be installed and active');
    echo "<div class='update-nag'>$msg</div>";
}

function gantry_missing_nag() {
    echo "This theme requires the Gantry Framework Plugin to be installed and active.";
    die(0);
}

// add editor the privilege to edit theme
// get the the role object
$role_object = get_role('editor');

// add $cap capability to this role object
$role_object->add_cap('edit_theme_options');

function fb_remove_menu_entries() {
    // with WP 3.1 and higher
    if (function_exists('remove_menu_page')) {
        remove_menu_page('edit-comments.php');
        remove_submenu_page('options-general.php', 'options-discussion.php');
        remove_menu_page('edit.php');
        remove_menu_page('link-manager.php');
        remove_submenu_page('themes.php', 'themes.php');
        remove_menu_page('profile.php');
        remove_menu_page('tools.php');
        remove_menu_page('index.php');
    }
}

if (current_user_can('editor')) {
    add_action('admin_menu', 'fb_remove_menu_entries');
    add_action('admin_head', 'add_styles');
}

function add_styles() {
    echo '
        <style type="text/css">
#toplevel_page_wpcf7{
display:none;
}
#toplevel_page_nivo-slider-for-wordpress-nivoslider4wp{
display:none}
#menu-settings{
display:none}
#nav-menu-theme-locations{
display:none}
#add-category{
display:none}
#wpadminbar{
display:none}
</style>
        ';
}

function remove_footer_admin() {
    echo 'ABEE lajt <a href="www.abee.pl/lite">www.abee.pl/lite</a> pomoc: 795 467 752 <a href="mailto:lajt@abee.pl">lajt@abee.pl</a>';
}

add_filter('admin_footer_text', 'remove_footer_admin');

add_filter('show_admin_bar', '__return_false');

?>